With reference to FIG. 1, a modern computer system may be divided roughly into four conceptual elements: the hardware (10), the operating system (12), the application programs (14), and the users (16, 18, 20, 22). The hardware (10), i.e., the microprocessor, the memory, and the input/output devices, provides the basic computing resources. The application programs (14), such as compilers, database systems, software, and business programs, define the ways in which these resources are used to solve the computing problems of the users. The users (16, 18, 20, 22), people, machines, and other computers, use the application programs, which in turn employ the hardware, to solve numerous types of problems.
An operating system (xe2x80x9cOSxe2x80x9d) (12) is a program that acts as an intermediary between a user of a computer system and the computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs in a convenient and efficient manner. A computer system has many resources (hardware and software) that may be required to solve a problem, e.g., central processing unit (xe2x80x9cCPUxe2x80x9d) time, memory space, file storage space, input/output (xe2x80x9cI/Oxe2x80x9d) devices, etc. The operating system acts as a manager of these resources and allocates them to specific programs and users as necessary for tasks. Because there may be many, possibly conflicting, requests for resources, the operating system must decide which requests are allocated resources to operate the computer system efficiently and fairly.
Moreover, an operating system can be characterized as a control program. A control program controls the execution of user programs to prevent errors and improper use of the computer. It is especially concerned with the operation of I/O devices. In general, operating systems exist because they are a reasonable way to solve the problem of creating a usable computing system. The fundamental goal of a computer system is to execute user programs and make solving user problems easier. Toward this goal, computer hardware (10) is constructed. Because bare hardware alone is not particularly easy to use, application programs are developed. These various programs require certain common operations, such as those controlling the I/O operations. The common functions of controlling and allocating resources are then brought together into one piece of software: the operating system. The operating system, in turn, needs a constant time reference to support the aforementioned tasks and administrative tasks such as thread scheduling, process scheduling, event scheduling, and other system related activities.
A typical operating system uses the CPU clock for its constant time reference. Modern CPUs have frequencies between 166 MHz to over 600 MHz. For example, an UltraSparc-IIe microprocessor developed by Sun Microsystems in Palo Alto, Calif., runs at speeds greater than 500 MHz, meaning that the processor goes through more than 500xc3x97106 CPU clock cycles per second.
In order to conserve energy, some computer systems incorporate power control mechanisms. For example, Energy Star (xe2x80x9cE*xe2x80x9d) power requirements require system power consumption to be lowered to 15% of the normal operating power consumption level when the system is idle. In order to meet this goal, the system must turn off (or lower the operating frequencies of) inactive devices (disk drives, network cards, etc.). In addition, the CPU itself should enter into power saving mode, because it is likely to be the most power-consuming device in the system.
To save power, the CPU must lower its operating frequency. The CPU cannot be turned off entirely because this, in effect, would shut down the entire system. When the CPU lowers its operating frequency, the time reference for the operating system changes, and it consequently performs its duties depending upon a varying time reference. During the change over to different frequency modes, the operating system loses its absolute reference of time, which it had before the frequency change, and counters using the CPU core clock increment at different rates as the frequency changes.
Because the operating system designates and allocates system resources to different tasks, it must have a constant time reference in order to perform those tasks effectively and efficiently. If there is not a constant time reference, the operating system is forced to attempt to schedule tasks using a fluctuating time reference. This results in the loss of many clock cycles while the operating system waits for a constant time reference to be established, and eventually this effect inhibits system performance.
The prior art allows an operating system to delay its requests and interrupts to system hardware when the CPU core frequency of the system is being changed. Hardware embodying such a system includes registers which base their clock cycles on a CPU clock to generate periodic interrupts to the operating system. However, when the CPU clock frequency changes as the system enters or exits a power save mode, the interrupt periods vary and therefore the operating system schedules events indeterministically. The prior art also embodies systems in which the operating system simply and waits for the system to complete its frequency change transition and accepts the loss of many clock cycles. All requests and interrupts are stalled until the system frequency has been changed to a desired frequency.
In one aspect, the invention relates to a system for implementing a power management scheme to conserve computer system power when computer resources are idle. The system further provides a plurality of power saving modes that can be entered into when designated by system software. The system further includes implementation of the power management scheme with minimal changes to pre-existing system conditions.
In another aspect, the invention relates to a method for providing a constant time reference for operating system support for event scheduling, process scheduling, and other administrative purposes. The method further includes providing a constant time reference when the system is changing to a power save mode and also when the system is in a power save mode.
In another aspect, the invention relates to a method for software to implement the power management scheme. The method includes software controlling the power management scheme by monitoring and determining when computer resources are idle and how the hardware should react to a designated power save mode request.
Other aspects and advantages of the invention will be apparent from the following description and the appended claims.